/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.system.dto.SystemProductAddDTO;
import com.pig4cloud.pigx.system.dto.SystemProductEditDTO;
import com.pig4cloud.pigx.system.entity.SystemProduct;
import com.pig4cloud.pigx.system.vo.SystemProductOptionVO;
import com.pig4cloud.pigx.system.vo.SystemProductVO;

import java.util.List;

/**
 * 产品
 *
 * @since 2022-11-23 15:15:20
 */
public interface SystemProductService extends IService<SystemProduct> {

    /**
     * 分页查询
     *
     * @param page      分页条件
     * @param condition 查询条件
     * @return {@link Page< SystemProductVO>}
     * @since 2022/11/24 10:48
     */
    Page<SystemProductVO> page(Page<SystemProduct> page, SystemProduct condition);

    /**
     * 新增
     *
     * @param dto 数据
     * @since 2022/11/24 11:31
     */
    void add(SystemProductAddDTO dto);

    /**
     * 修改
     *
     * @param dto 数据
     * @since 2022/11/24 11:31
     */
    void edit(SystemProductEditDTO dto);

    /**
     * 根据id逻辑删除
     *
     * @param id id
     * @since 2022/11/24 11:31
     */
    void del(Long id);

    /**
     * 查询选项数据
     *
     * @param condition 查询条件
     * @return {@link List< SystemProductOptionVO>}
     * @since 2022/11/24 14:26
     */
    List<SystemProductOptionVO> option(SystemProduct condition);

    /**
     * 初始化redis缓存
     */
    void initRedis();

    /**
     * 同步产品信息
     *
     * @param id id
     * @since 2023/1/28 15:48
     */
    void sync(Long id);

    /**
     * 同步所有可用产品信息
     *
     * @since 2023/1/28 15:49
     */
    void syncAll();
}
